package com.ymatou.auth.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.auth.parameter.GetLoginSafeStatusRequestDtoBean;
import com.ymatou.auth.service.GetLoginSafeStatusRequestDtoCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;

/**
*查询用户所有被风控的记录
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetLoginSafeStatusRequestDto{
	private static GetLoginSafeStatusRequestDtoBean getloginsafestatusrequestdtoBean;
	private static GetLoginSafeStatusRequestDtoCall getloginsafestatusrequestdtoCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("查询用户所有被风控的记录");
	}

	@Before
	public void caseUp() {
		getloginsafestatusrequestdtoBean=new GetLoginSafeStatusRequestDtoBean();
		getloginsafestatusrequestdtoCall=new GetLoginSafeStatusRequestDtoCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getloginsafestatusrequestdtoCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetLoginSafeStatusRequestDto_001() {
		Logger.start(true,"查询用户所有被风控的记录成功");
		try {
			getloginsafestatusrequestdtoBean.setLoginName("洋码头");
			getloginsafestatusrequestdtoCall.setData(getloginsafestatusrequestdtoBean);
			getloginsafestatusrequestdtoCall.callService();			
			Logger.verifyEquals("200", getloginsafestatusrequestdtoCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("true", getloginsafestatusrequestdtoCall.getString("Success").toString(), "验证Success");
			Logger.verifyIsContains("ok", getloginsafestatusrequestdtoCall.getString("LastErrorMessage"), "验证LastErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_GetLoginSafeStatusRequestDto_002() {
		Logger.start(false,"不输入loginid,失败");
		try {
			getloginsafestatusrequestdtoCall.setData(getloginsafestatusrequestdtoBean);
			getloginsafestatusrequestdtoCall.callService();			
			Logger.verifyIsContains("无效的LoginName", getloginsafestatusrequestdtoCall.getReturnData(), "验证LastErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_GetLoginSafeStatusRequestDto_003() {
		Logger.start(false,"输入错误的loginid,失败");
		try {
			getloginsafestatusrequestdtoBean.setLoginName("错误的登入名");
			getloginsafestatusrequestdtoCall.setData(getloginsafestatusrequestdtoBean);
			getloginsafestatusrequestdtoCall.callService();			
			Logger.verifyEquals("100", getloginsafestatusrequestdtoCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("true", getloginsafestatusrequestdtoCall.getString("Success").toString(), "验证Success");
			Logger.verifyIsContains("未找到该用户", getloginsafestatusrequestdtoCall.getString("LastErrorMessage"), "验证LastErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_GetLoginSafeStatusRequestDto_004() {
		//? 待确认 mongo数据已经洗成小写
		Logger.start(true,"查询大写字母开头用户所有被风控的记录成功JIRACONN-2123");
		try {
			getloginsafestatusrequestdtoBean.setLoginName("Vaifei");
			getloginsafestatusrequestdtoCall.setData(getloginsafestatusrequestdtoBean);
			getloginsafestatusrequestdtoCall.callService();			
			Logger.verifyEquals("200", getloginsafestatusrequestdtoCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("true", getloginsafestatusrequestdtoCall.getString("Success").toString(), "验证Success");
			Logger.verifyIsContains("ok", getloginsafestatusrequestdtoCall.getString("LastErrorMessage"), "验证LastErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}